<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload=function(){
            var oDiv = document.getElementById("mydiv");
            alert(oDiv.innerHTML);
            oDiv.innerHTML = "阳光正好";
        }
    </script>
</head>
<body>
    <div id="mydiv">今天是个好日子！</div>
</body>
</html>